package com.gopay.cron.thread;

import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.gopay.cron.service.cloud.EShopAccountGenFtpFileService;

/** 
 * @ClassName: CloudGenFileThread 
 * @Description: 生成云账户对账文件线程
 * @author liuxuyang
 * @date 2018年4月3日 下午12:28:04  
 */

public class CloudGenFileThread implements Runnable {
	
	private Logger logger = LoggerFactory.getLogger(this.getClass());
	
	private String filePath;
	private String checkDate;
	private Set<String> custIdSet;
	private EShopAccountGenFtpFileService eShopAccountGenFtpFileService;
	
	public CloudGenFileThread(EShopAccountGenFtpFileService service,String filePath,String checkDate,Set<String> custIdSet) {
		this.filePath = filePath;
		this.checkDate = checkDate;
		this.custIdSet = custIdSet;
		this.eShopAccountGenFtpFileService = service;
	}
	
	@Override
	public void run() {
		logger.info("手动开始生成E商通对账文件...");
    	
        try {
        	eShopAccountGenFtpFileService.genFile(filePath, checkDate, custIdSet);
        } catch(Exception e) {
        	logger.error("手动生成E商通对账文件失败...",e);
        }
        
        logger.info("手动生成E商通对账文件结束...");
	}

}
